package com.uvt.agenda.activities;

import android.app.Activity;
import android.os.Bundle;
import com.uvt.agenda.AndroidUtils;
import com.uvt.agenda.database.DatabaseManager;

/**
 * Created by Cristian Holdunu on 09/01/14.
 * 21:22
 */
public class BaseActivity extends Activity {
    protected DatabaseManager databaseManager;

    @Override
    public void onCreate(Bundle savedState) {
        super.onCreate(savedState);
        databaseManager = new DatabaseManager(this);
        databaseManager.openDataBase();

        AndroidUtils.setDbManager(databaseManager);

    }

    @Override
    public void onResume(){
        super.onResume();
        databaseManager.openDataBase();
    }

    @Override
    public void onPause(){
        super.onPause();
        databaseManager.close();
    }
}
